<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exercício 4</title>
</head>
<body>
<%

if (request.getParameter("nome") == null) {
	out.println("<h3>Preencha o formulário abaixo</h3>");
	out.println("<form id='form1' action='' method='POST' >");
	out.println("Nome: <input type='text' name='nome' size='40'><br />");
	out.println("idade: <input type='text' name='idade' size='40'><br />");
	out.println("Fone: <input type='text' name='fone' size='40'><br />");
	out.println("<p><input type='submit' value='Enviar' id='enviar'></p>");
	out.println("<br />");
	out.println("</form>");
}
else {
	out.println("<h3>Confirmar envio</h3>");
	out.println("<form id='form2' method='POST' >");
	out.println("<input type='hidden' name='nome' size='40' value='" + request.getParameter("nome") + "' ><br />");
	out.println("<input type='hidden' name='idade' size='40' value='" + request.getParameter("idade") + "'><br />");
	out.println("<input type='hidden' name='fone' size='40' value='" + request.getParameter("fone") + "'><br />");
	out.println("<p><input type='submit' value='Confirmar' id='confirmar'></p>");
	out.println("<br />");
	out.println("</form>");

}

%>


</body>
</html>
